package com.pro.controller;

import com.pro.pojo.JsMicrocircle;
import com.pro.pojo.JsonData;
import com.pro.service.JsMicroStatisticsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * ClassName:JsMicroStatisticsController
 * Package:com.pro.controller
 * Description:
 *
 * @Date:2021/12/8 下午 6:43
 * @Author: WYH
 */
@Controller
@RequestMapping("/microTree")
public class JsMicroStatisticsController {

    @Autowired
    private JsMicroStatisticsService jsMicroStatisticsService;

    @RequestMapping("/getAllThumbsUpCount")
    @ResponseBody
    public JsonData getAllThumbsUpCount() {
        List<JsMicrocircle> allThumbsUpCount = jsMicroStatisticsService.getAllThumbsUpCount();
        return allThumbsUpCount != null ? JsonData.buildSuccess(allThumbsUpCount) : JsonData.buildError("数据格式异常");
    }
    @RequestMapping("getAllcollectionCount")
    @ResponseBody
    public JsonData getAllcollectionCount() {
        List<JsMicrocircle> allcollectionCount = jsMicroStatisticsService.getAllcollectionCount();
        return allcollectionCount != null ? JsonData.buildSuccess(allcollectionCount) : JsonData.buildError("数据格式异常");
    }
    @RequestMapping("/getAllcommentCount")
    @ResponseBody
    public JsonData getAllcommentCount() {
        List<JsMicrocircle> allcommentCount = jsMicroStatisticsService.getAllcommentCount();
        return allcommentCount != null ? JsonData.buildSuccess(allcommentCount) : JsonData.buildError("数据格式异常");
    }
    @RequestMapping("/getAllclickcont")
    @ResponseBody
    public JsonData getAllclickcont() {
        List<JsMicrocircle> allclickcont = jsMicroStatisticsService.getAllclickcont();
        return allclickcont != null ? JsonData.buildSuccess(allclickcont) : JsonData.buildError("数据格式异常");
    }
    @RequestMapping("/getAllshare")
    @ResponseBody
    public JsonData getAllshare() {
        List<JsMicrocircle> allshare = jsMicroStatisticsService.getAllshare();
        return allshare != null ? JsonData.buildSuccess(allshare) : JsonData.buildError("数据格式异常");
    }
}
